#!/bin/sh

set -eu

jiapkg_build() {
	sed -i \
		's/"-DCMAKE_BOOTSTRAP=1"/"-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=OFF"/' \
		bootstrap
	./bootstrap --parallel="$JIAPKG_JOBS" --prefix="$JIAPKG_INSTALL_DIR/"
	make -j"$JIAPKG_JOBS"
}

jiapkg_install() {
	make install
}

case "$1" in
build) jiapkg_build ;;
install) jiapkg_install ;;
esac
